<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<div class="inc-header-top">
	<!-- 登录前 -->
	<c:if test="${current_member eq null }">
		<!-- 登录前 -->
		<div class="div-yljk w1200-auto">
			<div class="div-yljk-span">
				<span class="fl">你好，欢迎来到考霸!</span>
				<span><a href="${ctxPath}/member/index.htm">个人中心</a></span>
				<span>|</span>
				<span><a href="">消息提醒</a></span>
				<span>|</span>
				<span><a href="${ctxPath}/member/login.htm">登录</a></span>
				<span>|</span>
				<span><a href="${ctxPath}/member/regist.htm">注册</a></span>
			</div>
		</div>
	</c:if>
	<!-- 登陆后 -->
	<c:if test="${current_member ne null }">
		<!-- 登陆后 -->
		<div class="w1200-auto">
			<div class="div-yljk-grzl clb">
				<span class="fl"">你好，欢迎来到考霸!</span>
				<div class="fr">
					<span><a href="${ctxPath}/member/index.htm">${current_member.nickName}</a></span>
					<span class="color999 ml5 mr5">|</span>
					<span><a href="${ctxPath}/member/index.htm">个人中心</a></span>
					<span class="color999 ml5 mr5">|</span>
					<span><a href="">新消息 (0)</a></span>	
					<span class="color999 ml5 mr5">|</span>
					<span><a href="${ctxPath}/member/logout.htm">[ 退出 ]</a></span>
				</div>
			</div>
		</div>
	</c:if>
	</div>
	<div class="w1200-auto">
		<div class="di-header-top clb">
			<div class="di-htr fl">
				<div class="top-left dr-kaoba-img fl">
				   <a href="${ctxPath}/index.htm"><img alt="" src="${ctxPath}/static/front/base/images/kaoba-logo.png"></a>
				</div>
			</div>
			<form id="headSearch" method="GET" action="${ctxPath}/doc/list.htm">
				<input id="chooseId" name="condition.chooseId" value="${callBackChooseId}" hidden="hidden"/>
				<input id="docFileExtendNames" name="condition.docFileExtendNames" hidden="hidden"/>
				<div class="fl ml100">
					<div class="di-htl-top clb">
						<div class="di-dl-dt fl">
							<a href="#" class="clb">
								<span id="choose-key" class="choose-key fl">
									<c:if test="${callBackChooseId == null || callBackChooseId == ''}">按资料</c:if>
									<c:if test="${callBackChooseId == 1}">按学霸</c:if>
									<c:if test="${callBackChooseId == 2}">按老师</c:if>
									<c:if test="${callBackChooseId == 3}">按课程</c:if>
									<c:if test="${callBackChooseId == 4}">按用户</c:if>
								</span>
								<i class="kb-icon-1 fl" style="font-size:10px;"></i>
							</a>
	               			<dl class="condition-key" >
		                  		<dt>
		                  			<a href="#">按资料</a>
		                  			<input hidden="hidden"/>
		                  		</dt>
		                  		<dt>
		                   			<a href="#">按学霸</a>
		                  			<input value="1" hidden="hidden"/>
		                   		</dt>
		                   		<dt>
		                   			<a href="#">按老师</a>
		                  			<input value="2" hidden="hidden"/>
		                   		</dt>
		                   		<dt>
		                   			<a href="#">按课程</a>
		                  			<input value="3" hidden="hidden"/>
		                   		</dt>
		                   		<dt>
		                   			<a href="#">按用户</a>
		                  			<input value="0" hidden="hidden"/>
		                   		</dt>
	              			 </dl>
						</div>
						<input id="key" name="condition.key" value="${callBackKey}" type="text" class="di-search fl" placeholder="请输入关键词，可用空格断开组合查询" autocomplete="off"/>
						<a id="searchBtn" onclick="headSearch();return false;" class="search-btn fl" href="javaScript:void(0);"></a>
					</div>
					<div class="di-htl-bottom mt10">
						<label class="di-htl-label fl clb mr20">
					   		<input value="" class="di-bd-qb vm" <c:if test="${callBackDocFileExtendNames == ''}">checked</c:if> type="checkbox">
					   		<span class="vm">全部</span>
					   	</label>
					   	<label class="di-htl-label fl clb mr20">
					   		<input value="ppt" class="di-bd-qb vm" <c:if test="${fn:contains(callBackDocFileExtendNames,'ppt')}">checked</c:if> type="checkbox">
					   		<span class="vm">PPT</span>
					   	</label>
					   	<label class="di-htl-label fl clb mr20">
					   		<input value="xls" class="di-bd-qb vm" <c:if test="${fn:contains(callBackDocFileExtendNames,'xls')}">checked</c:if> type="checkbox">
					   		<span class="vm">XLS</span>
					   	</label>
					   	<label class="di-htl-label fl clb mr20">
					   		<input value="doc" class="di-bd-qb vm" <c:if test="${fn:contains(callBackDocFileExtendNames,'doc')}">checked</c:if> type="checkbox">
					   		<span class="vm">DOC</span>
					   	</label>
					   	<label class="di-htl-label fl clb mr20">
					   		<input value="txt" class="di-bd-qb vm" <c:if test="${fn:contains(callBackDocFileExtendNames,'txt')}">checked</c:if> type="checkbox">
					   		<span class="vm">TXT</span>
					   	</label>
					   	<label class="di-htl-label fl clb mr20">
					   		<input value="pdf" class="di-bd-qb vm" <c:if test="${fn:contains(callBackDocFileExtendNames,'pdf')}">checked</c:if> type="checkbox">
					   		<span class="vm">PDF</span>
					   	</label>
					   	<label class="di-htl-label fl clb mr20">
					   		<input value="free" class="di-bd-qb vm" <c:if test="${fn:contains(callBackDocFileExtendNames,'free')}">checked</c:if> type="checkbox">
					   		<span class="vm">免考土豆</span>
					   	</label>
					</div>
				</div>
			</form>
			<div class="fr grzl-span" style="text-align: right;">
				<a href="${ctxPath}/doc/list.htm?tag=16春考试">
					<img alt="" src="${ctxPath}/static/front/base/images/kaoba03-ico.png" width="210px" height="70px"/>
				</a>
			</div>
		</div>
	</div>
	<div style="background-color:#00a1e9;">
		<div class="w1200-auto di-header-bottom">
			<ul class="hb-text clb ">
				<li class="hb-hx fl" menu="1"><a href="${ctxPath}/index.htm">首页</a></li>
				<li class="hb-rzxb fl" menu="2"><a href="${ctxPath}/doc/list.htm">资料文档</a></li>
				<li class="hb-rzxb fl" menu="3"><a href="${ctxPath}/course/index.htm">所有课程</a></li>
				<li class="hb-rzxb fl" menu="4"><a href="${ctxPath}/cert/master.htm">认证学霸</a></li>
				<li class="hb-rzls fl" menu="5"><a href="${ctxPath}/cert/teacher.htm">认证老师</a></li>
			</ul>
		</div>
	</div>
</div>

<script>
	var menu = '${param.menu}';
	if(menu && menu.length > 0){
		$('.hb-text li').removeClass("hb-active");
		$('.hb-text li[menu='+menu+']').addClass("hb-active");
	}
	// 手机端菜单的展开收起
	$(".btn-navbar").click(function(){
		$(".lr-nav").slideToggle();
	});
	$(".lr-nav a").click(function(){
		var na =$(this).siblings(".nt-nav");
		$(na).slideToggle();
	});
	// 下拉菜单 
  	$(".condition-key dt").on("click",function(){
	  	$("#choose-key").html($(this).html());
	  	$("#chooseId").val($(this).find('input').val());
	  	$(this).parent("dl").hide();
  	});
	  
  	$(".di-dl-dt").hover(function(){
	  	$(".condition-key").show();
  	},function(){
	  	$(".condition-key").hide();
  	});

  	
  	$(function(){
  		//敲击回车
  		$("#headSearch").find("input").on("keydown",function(e){
  			if(e.keyCode == '13'){
  				headSearch();
  				return false;
  			}
  		});
  	});
	
	//查询表单提交
	function headSearch() {
  		//获取所有的扩展名
  		var fileExtendNames = [];
  	
  		$("input[type='checkbox']").each(function(){
  			if($(this).is(':checked')){
  				fileExtendNames.push($(this).val());
  			}
  		});
  		$("#docFileExtendNames").val(fileExtendNames.join(","));
  		
		//post实现页面的跳转 
		$('#headSearch').submit();
	}
</script>
